<template>
  <div class="risk">
    <!-- <div class="add" @click="add">新增</div> -->
    <eagle-page-list
      ref="eaglePageList"
      @bindData="bindData"
      :queryParams="queryParams"
      :url="url"
      :conditions="conditions"
      :pageSize="20"
      :placeholder="'请输入任务名、检查人搜索'"
    >
      <template #list>
        <eagle-cell
          style="margin-top: 10px"
          class="br-8"
          v-for="(item, index) in list"
          :key="index"
        >
          <div class="warn_item">
            <div @click="goDetail(item)">
              <eagle-row>
                <eagle-col span="24">
                  {{ index + 1 }}、{{ item.CheckTaskName }}</eagle-col
                >
              </eagle-row>
              <eagle-row gutter="20" class="dep_sort">
                <eagle-col span="12">
                  <img
                    src="@/assets/Images/AppIcon/icon_list_danger.png"
                    alt=""
                  />隐患/检查：{{ item.HiddenDangerCnt }}/{{
                    item.CheckCnt
                  }}</eagle-col
                >
              </eagle-row>
            </div>
        </div>
        </eagle-cell>
      </template>
    </eagle-page-list>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [],
      conditions: {},
      url: "/DangerCheckTaskDetail/GetCheckAreaDetailPageData",
      queryParams: {
        dataType: "TaskCheckRecord",
        areaType: "",
        areaCode: "",
      },
    };
  },
  created() {
    if (this.$route.query.areaType) {
      this.queryParams.areaType = this.$route.query.areaType;
    }
    if (this.$route.query.areaCode) {
      this.queryParams.areaCode = this.$route.query.areaCode;
    }
  },
  methods: {
    bindData(data) {
      this.list = [];
      if (data) {
        this.list = data;
      }
    },
    goDetail(item) {
      this.$router.push({
        path: "/Site_RiskUnit/CheckAreaDetailPage",
        query: { 
          ctCode: item.CTCode, 
          areaType: this.queryParams.areaType, 
          areaCode: this.queryParams.areaCode, 
          },
      });
    },
  },
};
</script>

<style lang="less" scoped>
.risk {
  background-color: #e8f1f8;
  .info_search {
    padding: 10px;
    border-radius: 5px !important;
    .van-field__control {
      background-color: #ffffff !important;
    }
  }
}
.dep_sort {
  // display: flex;
  // flex-wrap: wrap;
  // margin-bottom: 5px;
  img {
    height: 15px;
    width: 15px;
    margin-right: 5px;
  }
}
.van-cell
{
border-radius: 5px;
}
</style>
